﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace WebServer
{
    /// <summary>
    /// Represents and abstract server
    /// </summary>
    /// <typeparam name="Handler">The type of handlers this server uses</typeparam>
    interface IServer<Handler>
    {
        /// <summary>
        /// Starts the server
        /// </summary>
        void Start();

        /// <summary>
        /// Stops the server
        /// </summary>
        void Stop();

        /// <summary>
        /// Adds a handler that responds to the specified prefix
        /// </summary>
        /// <param name="prefix">The prefix pattern to match</param>
        /// <param name="handler">The handler</param>
        void AddHandler(String prefix, Handler handler);
    }
}
